#!/usr/bin/env python2
#import Image
from PIL import Image
import sys 
import os 
import pytesseract


#if len(sys.argv) != 2:
#    print "%s input_file output_file" % (sys.argv[0])
#    sys.exit()
#else:
#    input_file = sys.argv[1]


#def image_to_string(image, lang=None, boxes=False, config=None):
def my_image_to_string(input_file):
    if not os.path.isfile(input_file):
        print "No such file '%s'" % input_file
        sys.exit()
    return  (pytesseract.image_to_string(Image.open(input_file)))

if __name__ == '__main__':
    my_image_to_string(None)
